home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mint96sb.zoo / src / mint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-10  |  4.3 KB  |  213 lines

  1. /*
  2. Copyright 1990,1991,1992 Eric R. Smith. All rights reserved.
  3. */
  4.  
  5. #ifdef GENMAGIC
  6. #undef OWN_LIB
  7. #endif
  8.  
  9. #ifdef OWN_LIB
  10. #include "ctype.h"
  11. #else
  12. #include <ctype.h>
  13. #include <string.h>
  14. #endif
  15. #include <osbind.h>
  16.  
  17. /* configuration options */
  18.  
  19. /* make real processor exceptions (bus error, etc.) raise a signal */
  20. #define EXCEPTION_SIGS
  21.  
  22. /* deliberately fill memory with junk when allocating: used for testing */
  23. #undef JUNK_MEM
  24.  
  25. /* PATH_MAX is the maximum path allowed. The kernel uses this in lots of
  26.  * places, so there isn't much point in file systems allowing longer
  27.  * paths (they can restrict paths to being shorter if they want).
  28.  */
  29. #define PATH_MAX 128
  30.  
  31. /* maximum length of a string passed to ksprintf: this should be
  32.  * no more than PATH_MAX
  33.  */
  34. #define SPRINTF_MAX    PATH_MAX
  35.  
  36. /* NOTE: NAME_MAX is a "suggested" maximum name length only. Individual
  37.  * file systems may choose a longer or shorter NAME_MAX, so do _not_
  38.  * use this in the kernel for anything!
  39.  */
  40. #define NAME_MAX 14
  41.  
  42. /*
  43.  * configuration section: put compiler specific stuff here
  44.  */
  45.  
  46. #ifdef __GNUC__
  47. #define EXITING volatile    /* function never returns */
  48. #else
  49. #define EXITING
  50. #endif
  51.  
  52. #ifdef dLibs
  53. #define fullpath full_path
  54. #define SHORT_NAMES
  55. #endif
  56.  
  57. /* define to indicate unused variables */
  58. #ifdef __TURBOC__
  59. #define UNUSED(x)    (void)x
  60. #else
  61. #define UNUSED(x)
  62. #endif
  63.  
  64. /* define how to call functions with stack parameter passing */
  65. #ifdef __TURBOC__
  66. #define ARGS_ON_STACK cdecl
  67. #else
  68. #define ARGS_ON_STACK
  69. #endif
  70.  
  71. /* WARNING: Bconmap is defined incorrectly
  72.  * in the MiNT library osbind.h at patchlevel
  73.  * <= 19 and in early versions of the GNU C
  74.  * library. So use this binding for safety's sake.
  75.  */
  76.  
  77. #ifdef __GNUC__
  78. #undef Bconmap
  79. #define Bconmap(dev) (long)trap_14_ww(0x2c, dev)
  80. #endif
  81.  
  82. #ifndef __TURBOC__
  83. #ifndef Bconmap
  84. extern long xbios();
  85. #define Bconmap(dev) xbios(0x2c, dev)
  86. #endif
  87. #endif
  88.  
  89. /* Binding for Flock */
  90. #ifndef __TURBOC__
  91. #ifndef Flock
  92. extern long gemdos();
  93. /* this may need to be adjusted for your compiler/library */
  94. #define Flock(handle, mode, start, len) gemdos(0x5c, handle, mode, start, len)
  95. #endif
  96. #endif
  97.  
  98. #ifdef OWN_LIB
  99. /* Sigh. Some compilers are too clever for their
  100.  * own good; gcc 2.1 now makes strcpy() and some
  101.  * other string functions built-in; the built-in
  102.  * definitions disagree with ours. So we redefine
  103.  * them here. This also helps us to avoid conflict
  104.  * with any library stuff, in the event that we
  105.  * have to link in a library.
  106.  */
  107.  
  108. #define strlen    MS_len
  109. #define strcpy    MS_cpy
  110. #define strncpy    MS_ncpy
  111. #define strcat    MS_cat
  112. #define strncat    MS_ncat
  113. #define strcmp    MS_cmp
  114. #define strncmp    MS_ncmp
  115. #define strnicmp    MS_nicmp
  116. #define stricmp    MS_icmp
  117. #define strlwr    MS_lwr
  118. #define strupr    MS_upr
  119. #define sleep    M_sleep
  120. #endif
  121.  
  122. #ifdef SHORT_NAMES
  123. #define dispose_fileptr ds_fileptr
  124. #define dispose_region ds_region
  125. #define dispose_proc ds_proc
  126. #endif
  127.  
  128. /* prototype macro thingy */
  129. #ifdef __STDC__
  130. #define P_(x) x
  131. #else
  132. #define P_(x) ()
  133. #define const
  134. #define volatile
  135. #endif
  136.  
  137. #ifndef GENMAGIC
  138. #include "assert.h"
  139. #endif
  140. #include "atarierr.h"
  141. #include "basepage.h"
  142. #include "types.h"
  143. #include "signal.h"
  144. #include "mem.h"
  145. #include "proc.h"
  146.  
  147. #ifndef GENMAGIC
  148. #include "proto.h"
  149. #include "sproto.h"
  150. #endif
  151.  
  152. #ifndef NULL
  153. #define NULL ((void *)0)
  154. #endif
  155.  
  156. #ifndef TRUE
  157. #define TRUE 1
  158. #define FALSE 0
  159. #endif
  160.  
  161. /* is debugging info included? */
  162. #ifdef EZMINT
  163. #define NO_DEBUG_INFO
  164. #endif
  165.  
  166. #ifdef NO_DEBUG_INFO
  167. #define TRACE(x)
  168. #define DEBUG(x)
  169. #else
  170. #define TRACE(x) Trace x
  171. #define DEBUG(x) Debug x
  172. #endif
  173.  
  174. #define check_addr(x) 0
  175. #define yield() sleep(READY_Q, 0L)
  176.  
  177. #define CTRL(x) ((x) & 0x1f)
  178.  
  179. #ifndef GENMAGIC
  180.  
  181. extern short timestamp, datestamp;    /* in timeout.c */
  182.  
  183. typedef struct kbdvbase {
  184.     long midivec;
  185.     long vkbderr;
  186.     long vmiderr;
  187.     long statvec;
  188.     long mousevec;
  189.     long clockvec;
  190.     long joyvec;
  191.     long midisys;
  192.     long ikbdsys;
  193. } KBDVEC;
  194.  
  195. extern KBDVEC *syskey;
  196.  
  197. #define ST    0
  198. #define STE    0x00010000L
  199. #define MEGASTE 0x00010010L
  200. #define TT    0x00020000L
  201.  
  202. extern long mch;
  203.  
  204. extern int has_bconmap;    /* set in main() */
  205. extern int curbconmap;  /* see xbios.c */
  206.  
  207. /*
  208.  * load some inline functions, perhaps
  209.  */
  210. #include "inline.h"
  211.  
  212. #endif /* GENMAGIC */
  213.